/*
 * @Author: your name
 * @Date: 2021-07-21 10:01:43
 * @LastEditTime: 2021-07-26 10:57:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \STAMS\src\components\adminMenu.tsx
 */
import React from 'react';
import { Menu } from 'antd';
const { SubMenu } = Menu;
import {
  SolutionOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  UserOutlined,
  BookOutlined,
  TeamOutlined,
  LineChartOutlined,
  FormOutlined,
  CalendarOutlined,
} from '@ant-design/icons';
import { history, Link } from 'umi';

export default function AdminMenu() {
  return (
    <>
      <Menu
        mode="inline"
        defaultSelectedKeys={[history.location.pathname]}
        defaultOpenKeys={[
          history.location.pathname.slice(
            0,
            history.location.pathname.indexOf('/', 8),
          ),
        ]}
      >
        <Menu.Item key="/admin/studentInfo/index" icon={<UserOutlined />}>
          <Link to="/admin/studentInfo/index">学生信息管理</Link>
        </Menu.Item>
        <Menu.Item key="/admin/teacherInfo/index" icon={<UserOutlined />}>
          <Link to="/admin/teacherInfo/index">教师信息管理</Link>
        </Menu.Item>
        <Menu.Item key="/admin/projectTeam/index" icon={<TeamOutlined />}>
          <Link to="/admin/projectTeam/index">项目组管理</Link>
        </Menu.Item>
        <Menu.Item key="/admin/course/index" icon={<BookOutlined />}>
          <Link to="/admin/course/index">课程管理</Link>
        </Menu.Item>

        <SubMenu
          key="/admin/attendance"
          icon={<LineChartOutlined />}
          title="考勤管理"
        >
          <Menu.Item
            key="/admin/attendance/itemAttendance"
            icon={<LineChartOutlined />}
          >
            <Link to="/admin/attendance/itemAttendance">项目考勤记录</Link>
          </Menu.Item>
          <Menu.Item
            key="/admin/attendance/entranceGuard"
            icon={<LineChartOutlined />}
          >
            <Link to="/admin/attendance/entranceGuard">门禁打卡记录</Link>
          </Menu.Item>
        </SubMenu>
        <Menu.Item key="/admin/absence/index" icon={<CalendarOutlined />}>
          <Link to="/admin/absence/index">请假记录</Link>
        </Menu.Item>
        <SubMenu key="/admin/mark" icon={<FormOutlined />} title="综合打分记录">
          <Menu.Item key="/admin/mark/personScore" icon={<FormOutlined />}>
            <Link to="/admin/mark/personScore">个人评分</Link>
          </Menu.Item>
          <Menu.Item key="/admin/mark/teamScore" icon={<FormOutlined />}>
            <Link to="/admin/mark/teamScore">小组评分</Link>
          </Menu.Item>
        </SubMenu>
        <Menu.Item key="/global/changePassword" icon={<SolutionOutlined />}>
          <Link to="/global/changePassword">修改密码</Link>
        </Menu.Item>
      </Menu>
    </>
  );
}
